_h_a_n_d_l_e DDDDMMMMGGGG777722226666eeeennnnccccooooddddeeeerrrr structure, created by ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeeerrrrCCCCrrrreeeeaaaatttteeee((((3333ddddmmmm)))),
specifies the signal processing parameters.
_i_b_u_f pointer to input sample data buffer, an array of short (16
bits) for linear input or unsigned char for A-law or mu-law
input. For linear input, samples are assumed to be two's
complement. Data buffer must be a multiple (the same multiple
as that of output bitstrem buffer) of 4, 8, 2, or 8 for
operations at 16, 24, 32, or 40 kbit/s respectively. This
assumes the sampling rate of 8 kHz.
_o_b_u_f pointer to output compressed data buffer, an array of bytes.
The data format is unsigned char (8-bit). The output bitstrem
buffer consists of a multiple of 1, 3, 1, or 5 bytes, for
operations at 16, 24, 32, or 40 kbit/s respectively.
_n_u_m_S_a_m_p_l_e_s
number of samples to be processed. it must always be a multiple
of 4, 8, 2, or 8 for operations at 16, 24, 32, or 40 kbit/s
Returns DDDDMMMM____FFFFAAAAIIIILLLLUUUURRRREEEE or DDDDMMMM____SSSSUUUUCCCCCCCCEEEESSSSSSSS.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeee((((3333ddddmmmm)))) implements ITU G726 compression. G.726 compression
compresses one input sample to 2, 3, 4, or 5 bits for 16, 24, 32, or 40
kbit/s operations respectively. 16, 24, 32, or 40 kbit/s operation is
indicated by setting parameter DDDDMMMM____AAAAUUUUDDDDIIIIOOOO____BBBBIIIITTTTRRRRAAAATTTTEEEE to DDDDMMMM____GGGG777722226666____11116666____KKKKBBBBIIIITTTTSSSS,
DDDDMMMM____GGGG777722226666____22224444____KKKKBBBBIIIITTTTSSSS, DDDDMMMM____GGGG777722226666____33332222____KKKKBBBBIIIITTTTSSSS, or DDDDMMMM____GGGG777722226666____44440000____KKKKBBBBIIIITTTTSSSS using DMparams
and passed to ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeeerrrrSSSSeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))). Input format is indicated by
setting DDDDMMMM____GGGG777722226666____NNNNAAAATTTTIIIIVVVVEEEE____FFFFOOOORRRRMMMMAAAATTTT to DDDDMMMM____GGGG777722226666____UUUULLLLAAAAWWWW, DDDDMMMM____GGGG777722226666____AAAALLLLAAAAWWWW, or
DDDDMMMM____GGGG777722226666____LLLLIIIINNNNEEEEAAAARRRR____PPPPCCCCMMMM, respectively for inputting of mu-law, A-law, or
linear PCM data, using DMparams and passed to
ddddmmmmGGGG777722226666EEEEnnnnccccooooddddeeeerrrrSSSSeeeettttPPPPaaaarrrraaaammmmssss((((3333ddddmmmm)))). If input format is DDDDMMMM____GGGG777722226666____LLLLIIIINNNNEEEEAAAARRRR____PPPPCCCCMMMM, the
PCM data type will be short. Otherwise, the PCM data type will be
unsigned char. Therefore, the inbuf is void in the function prototyping.
G726 compression uses a linear prediction scheme. This means that the
compressed bits, which carrying compressed information, are interrelated
or interdependent. If a application calls aaaaffffSSSSeeeeeeeekkkkFFFFrrrraaaammmmeeee(3dm) to an offset
into the compressed bit stream file and then starts reading bits in the
middle of the bit stream and decompress them with ddddmmmmGGGG777722226666DDDDeeeeccccooooddddeeee(3dm), the
interdependency of the bits at the cutting point is lost. The
application will initially get back data with a lower amplitude than if
he had read the same data back during a complete pass over the file from
the beginning.
There is no way to exactly recreate the decoded data in the middle of the
bit stream file without going all the way back to the beginning.
However, with a "preroll" value to read ahead a portion of the compressed
file, application can compensate for the amplitude problem.
NNNNOOOOTTTTEEEE
G.726 algorithm was developed for sampling rate of 8 kHz, but could be